package com.example.gametestproject;

/**
 * @author HuXiaolong
 *
 */

import java.util.Vector;
import com.xxxx.game.*;

public class GameMatrix
{
	private JewelSprite[][] mJewels = null;
	private int mRows;
	private int mCols;
	
	public GameMatrix()
	{
		mJewels = null;
		mRows = 0;
		mCols = 0;
	}
	
	public GameMatrix(int rows, int cols)
	{
		mRows = rows;
		mCols = cols;
		mJewels = new JewelSprite[rows][cols];
	}
	
	public GameMatrix(JewelSprite[][] jewels)
	{
		mJewels = jewels;
		
		mRows = jewels.length;
		mCols = jewels[0].length;
	}
	
	public int getRows()
	{
		return mRows;
	}
	
	public int getCols()
	{
		return mCols;
	}
	
	public void setJewelSprites(JewelSprite[][] jewels)
	{
		mJewels = jewels;
	}
	
	public JewelSprite[][] getJewelSprites()
	{
		return this.mJewels;
	}
	
	public Vector<ISprite> toContainer()
	{
		Vector<ISprite> v = new Vector<ISprite>();
		// add jewel sprites
		for (JewelSprite[] js : this.mJewels)
		{
			for (JewelSprite x : js)
			{
				v.add(x);
			}
		}
		return v;
	}
}
